home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / MM2_DEV / S / MYUTIL / FASTBITS.M < prev    next >
Encoding:
Text File  |  1991-04-17  |  1.2 KB  |  49 lines

  1. MODULE FastBits;
  2.  
  3. FROM EasyGEM1 IMPORT SelectFile;
  4. FROM EasyGEM0 IMPORT FormAlert;
  5. FROM Strings IMPORT String;
  6. FROM Files IMPORT State, File, Access, Open, Close;
  7. FROM Binary IMPORT Seek, WriteByte, ReadWord, SeekMode;
  8.  
  9. VAR n, button: CARDINAL;
  10.     ok: BOOLEAN;
  11.     f: File;
  12.     name: String;
  13.  
  14. BEGIN
  15.   name:= '';
  16.   LOOP
  17.     FormAlert (3, "[0][ FASTBITS by Th.Tempelmann ][Set|Clear|Exit]", button);
  18.     IF button = 3 THEN
  19.       RETURN
  20.     END;
  21.     SelectFile ('', name, ok);
  22.     IF ok THEN
  23.       Open (f, name, readWrite);
  24.       IF State (f) < 0 THEN
  25.         FormAlert (1, "[1][ Error opening file ][OK]", button)
  26.       ELSE
  27.         ReadWord (f, n);
  28.         IF n # $601A THEN
  29.           Close (f);
  30.           FormAlert (1, "[1][ This is no program file ][OK]", button)
  31.         ELSE
  32.           Seek (f, 25, fromBegin);
  33.           IF button = 1 THEN
  34.             WriteByte (f, SHORT (7))
  35.           ELSE
  36.             WriteByte (f, SHORT (0))
  37.           END;
  38.           Close (f);
  39.           IF button = 1 THEN
  40.             FormAlert (1, "[0][ Fast bits are set ][OK]", button)
  41.           ELSE
  42.             FormAlert (1, "[0][ Fast bits are cleared ][OK]", button)
  43.           END
  44.         END
  45.       END
  46.     END
  47.   END (* LOOP *)
  48. END FastBits.
  49.